Release 10.1A: OpenEdge Development:
ADM and SmartObjects


Localizing standard SmartObject behavior

Another advantage of using super procedures to implement classes of behavior is that you can localize each of the internal procedures and functions that compose a super procedure in any individual SmartObject by writing a procedure or function of the same name. You can do this either to replace the standard behavior or to augment the standard behavior as required by the SmartObject. The Section Editor supports this functionality by identifying the internal procedures and functions that you can override based on the type of object you are creating.

To create a new displayFields procedure for a SmartDataViewer in the AppBuilder:

  1. In the Object Palette, right-click on the SmartDataViewer button.
  2. Choose New SmartDataViewer.
  3. Complete the steps in the SmartDataViewer wizard.
  4. On the AppBuilder toolbar, choose the Edit code button.
  5. Change the Section to Procedures.
  6. Click the New button. The New Procedure dialog box appears.
  7. Choose the Override Type radio button. The Name fill-in field becomes a combo box:
  8. Choose the displayFields procedure and click OK. The Section Editor generates a skeleton of the local procedure or function. This contains the necessary parameter definitions and, by default, invokes the standard behavior by executing the RUN SUPER or RUN SUPER ( ) statement:
  9. You can change this code as required for your application. For example, to change the color of the fields in the SmartDataViewer, change the code as shown:
  10. Note: This code augments the standard displayFields behavior and affects all instances created from this master.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095